void BFS() {
   
    if (route.size() > 0) {
        current = route.get(0);
        if (current == end) {
            findpath = true;
            println("Found!");
            println("steps:" + steps);
            drawWindow(0);
            return;//!
        }
       // current.step = steps;
        route.remove(current);  //弹出队头

        ArrayList<Cell> neighbours = current.neighbours;
        for (Cell neighbour : neighbours) {
            if (!neighbour.visited) {
                neighbour.visited = true;
                neighbour.previous = current;
                route.add(neighbour);//加入队尾
            }
        }
        drawWindow(0);

    } else {
        println("No solution");
        drawWindow(0);
        noLoop();
        return;
    }
    delay(delay_t);//放在下面，找到终点draw之后就return了,不会再Delay

    // backtrack不能放这里是因为当current==end就到不了这里，从而触发不了backtrack，
    //进而不能触发backtrack里面的绘制回溯路径
}
